package com.whxd.smarthome.api.rest.dto;

import java.util.ArrayList;
import java.util.List;

import com.whxd.smarthome.core.entity.DhDeviceChannel;

public class GetDeviceChannelsResponseDto {
	private String deviceId;// 设备ID
	private boolean online;// [bool]是否在线
	private String deviceModel;// 设备型号
	private String name;// 设备名称
	private boolean beSharedTo;// [bool]是否分享给别人的
	private boolean beSharedFrom;// [bool]是否从别人那里分享的

	private List<ChannelDto> channels = new ArrayList<ChannelDto>();

	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}

	public boolean isOnline() {
		return online;
	}

	public void setOnline(boolean online) {
		this.online = online;
	}

	public String getDeviceModel() {
		return deviceModel;
	}

	public void setDeviceModel(String deviceModel) {
		this.deviceModel = deviceModel;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isBeSharedTo() {
		return beSharedTo;
	}

	public void setBeSharedTo(boolean beSharedTo) {
		this.beSharedTo = beSharedTo;
	}

	public boolean isBeSharedFrom() {
		return beSharedFrom;
	}

	public void setBeSharedFrom(boolean beSharedFrom) {
		this.beSharedFrom = beSharedFrom;
	}

	public List<ChannelDto> getChannels() {
		return channels;
	}

	public void setChannels(List<ChannelDto> channels) {
		this.channels = channels;
	}

	public GetDeviceChannelsResponseDto(String deviceId, boolean online,
			String deviceModel, String name,
			List<DhDeviceChannel> dhDeviceChannels) {
		super();
		this.deviceId = deviceId;
		this.online = online;
		this.deviceModel = deviceModel;
		this.name = name;
		if (channels != null) {
			for (DhDeviceChannel dhDeviceChannel : dhDeviceChannels) {
				channels.add(new ChannelDto(dhDeviceChannel));
			}
		}
	}

	public GetDeviceChannelsResponseDto() {
		super();
	}
}
